package com.yicun.HttpUtils.NetWorkState;

import android.content.Context;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;

/* loaded from: classes.dex */
public class LiveNetworkMonitor implements NetworkMonitor {
    private final Context applicationContext;

    public LiveNetworkMonitor(Context context) {
        this.applicationContext = context.getApplicationContext();
    }

    @Override // com.example.MoJuGuiDingZhi.HttpUtils.NetWorkState.NetworkMonitor
    public boolean isConnected() {
        NetworkInfo activeNetworkInfo = ((ConnectivityManager) this.applicationContext.getSystemService("connectivity")).getActiveNetworkInfo();
        return activeNetworkInfo != null && activeNetworkInfo.isConnectedOrConnecting();
    }
}